package com.example.hello;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.v4.widget.DrawerLayout;
import android.support.v7.app.AppCompatActivity;
import android.widget.LinearLayout;

public class NewsActivity extends AppCompatActivity {

    DrawerLayout mDrawerLayout;
    LinearLayout slidLayout;


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_news);
        mDrawerLayout=(DrawerLayout)findViewById(R.id.drawerLayout);
        slidLayout=(LinearLayout)findViewById(R.id.slide_layout);
//        mDrawerLayout.setOnClickListener(new View.OnClickListener() {
//            @Override
//            public void onClick(View v) {
//               if(mDrawerLayout.isDrawerOpen(slidLayout)) {
//                   mDrawerLayout.closeDrawer(slidLayout);
//               }else {
//                   mDrawerLayout.openDrawer(slidLayout);
//               }
//            }
//        });

    }

    /**
     * 跳转到NewsActivity
     * @param context
     */
    public static void goToNewsActivity(Context context){
        Intent intent=new Intent(context,NewsActivity.class);
        context.startActivity(intent);
    }
}
